package light.mvc.model.register;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import light.mvc.model.base.IdEntity;
import light.mvc.model.item.TchemicalExam;
import light.mvc.model.item.TxRay;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

@Entity
@Table(name = "register_charge")
@DynamicInsert(true)
@DynamicUpdate(true)
public class TregisterCharge extends IdEntity implements java.io.Serializable{
	private static final long serialVersionUID = 1L;
	
	private Tregister register;
	
	private TxRay xRay;
	private TchemicalExam chemicalExam;
	
	private Date addTime;
	private Date chargeTime;
	
	private TchargeXRay chargeXRay;
	private TchargeChemicalExam chargeChemicalExam;
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "register_id")
	public Tregister getRegister() {
		return register;
	}
	public void setRegister(Tregister register) {
		this.register = register;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "xRay_id")
	public TxRay getxRay() {
		return xRay;
	}
	public void setxRay(TxRay xRay) {
		this.xRay = xRay;
	}
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "chemicalExam_id")
	public TchemicalExam getChemicalExam() {
		return chemicalExam;
	}
	public void setChemicalExam(TchemicalExam chemicalExam) {
		this.chemicalExam = chemicalExam;
	}
	
	@OneToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "registerChargeXRay_id")
	public TchargeXRay getChargeXRay() {
		return chargeXRay;
	}
	public void setChargeXRay(TchargeXRay chargeXRay) {
		this.chargeXRay = chargeXRay;
	}
	
	@OneToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "registerChargeChemicalExam_id")
	public TchargeChemicalExam getChargeChemicalExam() {
		return chargeChemicalExam;
	}
	public void setChargeChemicalExam(TchargeChemicalExam chargeChemicalExam) {
		this.chargeChemicalExam = chargeChemicalExam;
	}
	
	public Date getAddTime() {
		return addTime;
	}
	public void setAddTime(Date addTime) {
		this.addTime = addTime;
	}
	public Date getChargeTime() {
		return chargeTime;
	}
	public void setChargeTime(Date chargeTime) {
		this.chargeTime = chargeTime;
	}
	
}
